﻿using PLCS.Application.Contracts.TrayApp.Dtos;
using PLCS.Domain.Shared.Stations;
using PLCS.Shared.Common.Constant;

using System.ComponentModel;

namespace PLCS.Application.Contracts.StationApp.Dtos
{
    public class StationDto : EntityDto<Guid>
    {
        /// <summary>
        /// 工厂编码
        /// </summary>
        public string? SiteNo { get; set; }

        /// <summary>
        /// 车间编码
        /// </summary>
        public string? AreaNo { get; set; }

        /// <summary>
        /// 产线编码
        /// </summary>
        public string? PdLineNo { get; set; }

        /// <summary>
        /// 工位名称
        /// </summary>
        public string StaName { get; set; }

        /// <summary>
        /// 工位名称MES
        /// </summary>
        public string StaName_Higher { get; set; }

        /// <summary>
        /// 工位名称PLC
        /// </summary>

        public string StaName_Lower { get; set; }

        /// <summary>
        /// 工位编号
        /// </summary>
        public string StaNum { get; set; }

        /// <summary>
        /// 工位类型
        /// </summary>
        public StationType StationType { get; set; }

        /// <summary>
        ///  最高容量
        /// </summary>
        public int Capacity { get; set; }

        /// <summary>
        /// 兼容托盘类型
        /// </summary>
        public string MultipleTrayType { get; set; }

        /// <summary>
        /// 工位状态
        /// </summary>
        public DeviceStatus StaStatus { get; set; }

        /// <summary>
        /// 当前个数（托盘机）
        /// </summary>
        public int TrayCount { get; set; }

        public Dictionary<string, YesNo> CanInSideStatus { get; set; }

        public Dictionary<string, YesNo> CanOutStatus { get; set; }

        /// <summary>
        /// 空满位状态
        /// </summary>
        public YesNo HaveStatus { get; set; } = YesNo.否;

        /// <summary>
        /// 分类（工位的功能，比如多个工位同属于低压缓存）
        /// </summary>
        public string Kind { get; set; }

        /// <summary>
        /// 优先级（在同一个分类下，会考虑优先级）
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 最近一次进工位时间
        /// </summary>
        public DateTime? LastEnterDate { get; set; }

        /// <summary>
        /// 完工信号
        /// </summary>
        public YesNo Completion_Signal { get; set; }

        /// <summary>
        /// 缓存工位
        /// </summary>
        public string? CacheStation { get; set; }

        /// <summary>
        /// 平行工位
        /// </summary>
        public string? ParallelStation { get; set; }

        /// <summary>
        /// 故障代码
        /// </summary>
        public int ErrCode { get; set; }

        /// <summary>
        /// 工位锁定状态
        /// </summary>
        public YesNo IsLocked { get; set; }

        /// <summary>
        /// 可取设备
        /// </summary>
        public string? CanTake_EquNum { get; set; }

        /// <summary>
        /// 可送设备
        /// </summary>
        public string? CanSend_EquNum { get; set; }

        /// <summary>
        /// 是否使用
        /// </summary>
        public YesNo IsUse { get; set; } = YesNo.是;

        /// <summary>
        /// 满位状态变化触发事件
        /// </summary>
        public string? FullChangedMethodName { get; set; }

        /// <summary>
        /// 变空位变化触发方案
        /// </summary>
        public string? EmptyChangedMethodName { get; set; }

        public List<TrayDto>? Trays { get; set; }
    }
}